home *** CD-ROM | disk | FTP | other *** search
- Components.utils.import("resource://samfind/rss/samfind_modrssutils.jsm");
-
- var EXPORTED_SYMBOLS = ["samfindRSSGetLink", "samfindRSSGetTitle", "samfindRSSGetDate", "samfindRSSGetImage", "samfindRSSGetContent"];
-
- function samfindRSSGetLink(websiteRssUrl, item)
- {
- var content = (item.getElementsByTagName("description"))[0];
- if (content)
- {
- content = content.textContent.replace(/&(lt|gt);/g, function(strMatch, p1){return (p1 == "lt") ? "<" : ">";});
- var start = content.indexOf('<br/> <a href="');
- if (start != -1)
- {
- start += 15;
- var end = content.indexOf('">[link', start);
- if (end != -1)
- {
- return "javascript:samfind_rss.goTo('" + content.substring(start, end) + "');";
- }
- }
- }
- return null;
- }
-
- function samfindRSSGetTitle(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetDate(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetImage(websiteRssUrl, item)
- {
- return " ";
- }
-
- function samfindRSSGetContent(websiteRssUrl, item, title, link)
- {
- var content = (item.getElementsByTagName("description"))[0];
- if (!content)
- {
- return null;
- }
- var response = content.textContent.replace(/&(lt|gt);/g, function(strMatch, p1){return (p1 == "lt") ? "<" : ">";});
- var start = response.indexOf('<br/> <a href="');
- if (start != -1)
- {
- start += 5;
- var end = response.indexOf('">[link]</a> ', start);
- if (end != -1)
- {
- response = response.replace(response.substring(start, end + 12), "");
- }
- }
- response = response.replace(/[\[\]]/g, "");
- return response;
- }